package com.jonniespratley.generators
{
	public interface IMySQL
	{
		
	/* Data Definition Statements */
	function alterDatabase( database:String = null, charset:String = null, collation:String = null ):String;
	function alterTable( database:String, table:String, specification:Array = null ):String;
	function createDatabase( database:String, charset:String = null, collation:String = null ):String;
	
	/* 
	CREATE INDEX part_of_name ON customer (name(10) ); 
	*/
	function createIndex( database:String, table:String, column:String, length:int = 11 ):String;
	
	/* 
	CREATE TABLE lookup
	(id INT, INDEX USING BTREE (id))
	ENGINE = MEMORY;
	  */
	function createTable( database:String, table:String, columns:Array ):String;
	
	/* 
	DROP {DATABASE | SCHEMA} [IF EXISTS] db_name 
	*/
	function dropDatabase( database:String, ifExists:Boolean = true ):String;
	
	/* 
	DROP INDEX index_name ON tbl_name 
	*/
	function dropIndex( database:String, table:String, index:String ):String;
	
	/* 
	DROP [TEMPORARY] TABLE [IF EXISTS]
    tbl_name [, tbl_name] ...
    [RESTRICT | CASCADE] 
    */
	function dropTable( database:String, table:String, ifExists:Boolean = true ):String;
	
	/* 
	RENAME TABLE tbl_name TO new_tbl_name 
	*/
	function renameTable( database:String, oldTable:String, newTable:String ):String;
	
		
	/* Data Manipulation Statements */
	
	/* 
	DELETE [LOW_PRIORITY] [QUICK] [IGNORE] FROM tbl_name
    [WHERE where_condition]
    [ORDER BY ...]
    [LIMIT row_count]
     DELETE FROM somelog WHERE user = 'jcole'
	ORDER BY timestamp_column LIMIT 1;
	*/
	function deleteStatement( database:String, table:String, columnValuePair:Array ):String;
	
	
	/* 
	LOAD DATA INFILE 'data.txt' INTO TABLE db2.my_table; 
	*/
	function loadDataStatement( database:String, table:String, filename:String ):String;

	
	/* 
	INSERT INTO tbl_name (a,b,c) VALUES(1,2,3),(4,5,6),(7,8,9);
	*/
	function insertStatement( database:String, table:String, columnValuePair:Array ):String;
	function updateStatement( database:String, table:String, columnValuePair:Array ):String;
	
	/*   
	A table reference can be aliased using tbl_name AS alias_name or tbl_name alias_name:

	SELECT t1.name, t2.salary FROM employee AS t1, info AS t2
	WHERE t1.name = t2.name;

	SELECT t1.name, t2.salary FROM employee t1, info t2
	WHERE t1.name = t2.name;
  
	Columns selected for output can be referred to in ORDER BY and GROUP BY clauses using column names, column aliases, or column positions. 
	Column positions are integers and begin with 1:

	SELECT college, region, seed FROM tournament
	ORDER BY region, seed;

	SELECT college, region AS r, seed AS s FROM tournament
	ORDER BY r, s;

	SELECT college, region, seed FROM tournament
	ORDER BY 2, 3;*/
	function selectStatement( database:String, table:String, selectExpr:String = '*', conditionExpr:Array = null ):String;
	
	
	/* 
	This is a conservative extension if we consider each comma in a list of table_reference items as equivalent to an inner join. 
	For example:

	SELECT * FROM t1 LEFT JOIN (t2, t3, t4)
    ON (t2.a=t1.a AND t3.b=t1.b AND t4.c=t1.c) 
                 
	A table reference can be aliased using tbl_name AS alias_name or tbl_name alias_name:

	SELECT t1.name, t2.salary
	FROM employee AS t1 INNER JOIN info AS t2 ON t1.name = t2.name;

	SELECT t1.name, t2.salary
	FROM employee t1 INNER JOIN info t2 ON t1.name = t2.name;
  
	SELECT table1.* FROM table1
	LEFT JOIN table2 ON table1.id=table2.id
	WHERE table2.id IS NULL;
	*/
	function selectJoinStatement( database:String, table:String, fromTable:String, columnValuePair:Array = null ):String;
	function selectUnionStatement( database:String, table:String, fromTable:String, columnValuePair:Array = null ):String;
	
	function getClients():String;
	function getCommands():String;
	function getConnections():String;
	function getInnoDB():String;
	function getKeys():String;
	function getOpen():String;
	function getPerformance():String;
	function getQueryCache():String;
	function getQuestions():String;
	function getReplication():String;
	function getServerInfo():String;
	function getShowCommands():String;
	function getSort():String;
	function getTemp():String;
	function getThreads():String;
	function getSystemStatus():String;
	function getSystemVariables():String;
	function getSystemUsers():String;
	function getSystemProcesses():String;
	function getSystemPrivileges():String;

	function showCharacterSet():String;
	function showCollation():String;
	function showCreateDatabase( database:String ):String;
	function showCreateProcedure():String;
	function showCreateFunction():String;
	function showCreateTable( database:String, table:String ):String;
	function showCreateView():String;
	function showDatabases():String;
	function showEngine():String;
	function showEngines():String;
	function showErrors():String;
	function showGrants():String;
	function showIndex( database:String, table:String ):String;
	function showOpenTables( database:String ):String;
	function showStatus( database:String ):String;
	function showTableStatus( database:String ):String;
	function showProcesslist():String;
	function showWarnings():String;
	function showTriggers():String;
	function showTables( database:String ):String;
	

		
		
		
	}
}